package com.lingnan.util;

import com.alibaba.fastjson.JSONObject;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;

/**
 * @author 梁兴达
 * @date 2022/3/6
 */
public class RestTemplateUtils<T> {
    public static <T>HttpEntity getHeader(T param){
        HttpHeaders headers = new HttpHeaders();
        headers.add("token", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxMDAwMCJ9.1_p7RIINRzcUiL_nFZEiwr6yTrVDX8noIbwLoAJw7V0");
        headers.setContentType(MediaType.APPLICATION_JSON);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        return new HttpEntity<T>(param, headers);
    }
}